#BIKIN BRIDGE.SH DAN CHMOD +x pada usr/sbin/
#!/bin/sh -e
ifconfig eth0 0.0.0.0 promisc up
ifconfig eth1 0.0.0.0 promisc up
#
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
#
ifconfig br0 192.168.2.254 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev br0
#
ebtables -t broute -F
ebtables -t broute -A BROUTING -i eth1 -p ipv4 --ip-proto tcp --ip-dport 80 -j redirect --redirect-target DROP
ebtables -t broute -A BROUTING -i eth1 -p ipv4 --ip-proto tcp --ip-dport 443 -j redirect --redirect-target DROP
ebtables -t broute -A BROUTING -i eth0 -p ipv4 --ip-proto tcp --ip-sport 80 -j redirect --redirect-target DROP
ebtables -t broute -A BROUTING -i eth0 -p ipv4 --ip-proto tcp --ip-sport 443 -j redirect --redirect-target DROP
#
cd /proc/sys/net/bridge/
for i in *
do
echo 0 > $i
done
unset i

exit 0

